home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume14 / mn / patch01 < prev    next >
Encoding:
Text File  |  1990-09-15  |  4.8 KB  |  150 lines

  1. Newsgroups: comp.sources.misc
  2. X-UNIX-From: wiml@milton.u.washington.edu
  3. subject: v14i089: "mn" mail summary/tally; patch01
  4. from: William Lewis <wiml@milton.u.washington.edu>
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 14, Issue 89
  8. Submitted-by: William Lewis <wiml@milton.u.washington.edu>
  9. Archive-name: mn/patch01
  10.  
  11.   
  12.    A very small patch to "mn" of a month or two ago is included below.
  13. The README in the shar gives details (what few there are on a 5-line
  14. patch =8) ). Thanks.
  15.  
  16.  
  17. #! /bin/sh
  18. # This is a shell archive, meaning:
  19. # 1. Remove everything above the #! /bin/sh line.
  20. # 2. Save the resulting text in a file.
  21. # 3. Execute the file with /bin/sh (not csh) to create:
  22. #    README_patch1
  23. #    patch1
  24. # This archive created: Wed Sep 12 19:20:45 1990
  25. export PATH; PATH=/bin:/usr/bin:$PATH
  26. echo shar: "extracting 'README_patch1'" '(405 characters)'
  27. if test -f 'README_patch1'
  28. then
  29.     echo shar: "will not over-write existing file 'README_patch1'"
  30. else
  31. sed 's/^X//' << \SHAR_EOF > 'README_patch1'
  32. X   This is a trivial change; mn wasn't handling messages without a
  33. X"Subject: " header line correctly. Thanks to Kingsley Kerce and
  34. XHenry Bruce (who I couldn't respond to by mail; sorry) for pointing
  35. Xout the problem. 
  36. X   As patched, mn substitutes the null string "" as the subject for
  37. Xsubjectless messages. However, line 60,
  38. X   static char *nullsub = "";
  39. Xcan be changed to any string constant if desired.
  40. SHAR_EOF
  41. if test 405 -ne "`wc -c < 'README_patch1'`"
  42. then
  43.     echo shar: "error transmitting 'README_patch1'" '(should have been 405 characters)'
  44. fi
  45. fi
  46. echo shar: "extracting 'patch1'" '(2864 characters)'
  47. if test -f 'patch1'
  48. then
  49.     echo shar: "will not over-write existing file 'patch1'"
  50. else
  51. sed 's/^X//' << \SHAR_EOF > 'patch1'
  52. X*** postd/mn.c    Thu Aug 23 18:16:31 1990
  53. X--- mn.c    Thu Aug 23 18:33:32 1990
  54. X***************
  55. X*** 5,10
  56. X  of output, mainly for human consumption.
  57. X  
  58. X  */
  59. X  /*
  60. X      options:
  61. X  
  62. X
  63. X--- 5,11 -----
  64. X  of output, mainly for human consumption.
  65. X  
  66. X  */
  67. X+ /* Version:1  Patchlevel:1 */
  68. X  /*
  69. X      options:
  70. X  
  71. X***************
  72. X*** 56,61
  73. X  
  74. X  extern char *index(), *rindex(), *malloc();   /* minimal header files? */
  75. X  char *dynamicize();
  76. X  
  77. X  main(argc, argv)  int argc; char **argv;
  78. X  {int state;         /* 0 = waiting for 'from', 1=in header, 2=in body */
  79. X
  80. X--- 57,63 -----
  81. X  
  82. X  extern char *index(), *rindex(), *malloc();   /* minimal header files? */
  83. X  char *dynamicize();
  84. X+ static char *nullsub = "";
  85. X  
  86. X  main(argc, argv)  int argc; char **argv;
  87. X  {int state;         /* 0 = waiting for 'from', 1=in header, 2=in body */
  88. X***************
  89. X*** 197,202
  90. X         ; /* search for first blank */
  91. X      buf[i] = (char)0;  /* terminate the string there */
  92. X      from = dynamicize(buf+FROMOFF);
  93. X     }
  94. X     if(state==1 && !(style==OFROM || style==ADDRONLY) &&
  95. X         !strncmp("Subject:", buf, SUBOFF)) /* grab the subj string */
  96. X
  97. X--- 199,206 -----
  98. X         ; /* search for first blank */
  99. X      buf[i] = (char)0;  /* terminate the string there */
  100. X      from = dynamicize(buf+FROMOFF);
  101. X+     if(sub) free(sub);     /* don't reuse old subject lines */ 
  102. X+     sub = NULL;
  103. X     }
  104. X     if(state==1 && !(style==OFROM || style==ADDRONLY) &&
  105. X         !strncmp("Subject:", buf, SUBOFF)) /* grab the subj string */
  106. X***************
  107. X*** 237,242
  108. X      if(!index(buf+STATOFF, 'R'))  /* read mail? */
  109. X       unread++;  else tych = (tych == 'U')?'O':'?';
  110. X  
  111. X      switch(style)   /* output this msg. in correct style */
  112. X      {
  113. X       case SIMPLE:
  114. X
  115. X--- 241,248 -----
  116. X      if(!index(buf+STATOFF, 'R'))  /* read mail? */
  117. X       unread++;  else tych = (tych == 'U')?'O':'?';
  118. X  
  119. X+     if(!sub) sub = nullsub;  /* non-dynamic null string to ease output */
  120. X+     /* should be reset to NULL after output so as not to be freed */
  121. X      switch(style)   /* output this msg. in correct style */
  122. X      {
  123. X       case SIMPLE:
  124. X***************
  125. X*** 290,295
  126. X       default:
  127. X        puts("Unimplemented style"); break;  /* this should never happen ;-) */
  128. X      }  /* end of style-output switch() */
  129. X     }  /* end of if(Status:) test */
  130. X     if(remains > 0 && (state == 0 || state == 2)) /*need to fill rest of line?*/
  131. X     {char *cp; int spflag = 0;    /* stick this line onto end of line */
  132. X
  133. X--- 296,302 -----
  134. X       default:
  135. X        puts("Unimplemented style"); break;  /* this should never happen ;-) */
  136. X      }  /* end of style-output switch() */
  137. X+     if(sub == nullsub) sub = NULL;  /* reset null sub. to NULL again */
  138. X     }  /* end of if(Status:) test */
  139. X     if(remains > 0 && (state == 0 || state == 2)) /*need to fill rest of line?*/
  140. X     {char *cp; int spflag = 0;    /* stick this line onto end of line */
  141. SHAR_EOF
  142. if test 2864 -ne "`wc -c < 'patch1'`"
  143. then
  144.     echo shar: "error transmitting 'patch1'" '(should have been 2864 characters)'
  145. fi
  146. fi
  147. exit 0
  148. #    End of shell archive
  149.  
  150.